using Microsoft.Win32.SafeHandles;
using Zhaoxi.Zhihu.Core.QuestionAggregate.Entites;
using Zhaoxi.Zhihu.SharedKerel.Specification;

namespace Zhaoxi.Zhihu.Core.QuestionAggregate.Specifications;

public class AnswerByIdAndCreatedBySpec: Specification<Question>
{
    public AnswerByIdAndCreatedBySpec(int userId,int questionId,int answerId)
    {
        FilterCondition = q=> q.Id == questionId;
        AddInclude(q=> q.Answers.Where(a=> a.Id == answerId && a.CreatedBy == userId));
    }
}